import { ref } from 'vue';

const useWelfareEditor = () => {
    const { proxy } = getCurrentInstance() as ComponentInternalInstance;

    const editorVisible = ref(false);
    const editirObj = ref({});

    /**
     * @description: 打开编辑弹窗
     */
    const handleEditClick = (row: any) => {
        if (row.approvalStatus == '2') return proxy?.$modal.msgError('福利采购订单审核已经通过，请勿重复点击!')

        editirObj.value = row;
        editorVisible.value = true;
    };

    return {
        editorVisible,
        editirObj,
        handleEditClick
    }
};

export default useWelfareEditor;